var express = require('express');
var db = require('../../../tools/database');
var util = require('../../../tools/util');

var router = express.Router();

// 获取卖家信息
router.use(function (req, res, next) {

    util.jwtVerify(req, res, (decoded) => {
        // JWT验证成功, 获取要查询的用户名
        // 得到商品卖家的信息, 用户名不可以直接用Token中的信息
        let userName = req.query.userName
        let sql = `SELECT UserWeChat,UserQQ FROM Users WHERE UserName=?`
        db.queryRespond(sql, [userName], res, true)
    })

});

module.exports = router;